#include "Stack.h"

void test1() {
    printf("test1\n");
    Stack* stack = StackInit();
    StackPush(stack, 1);
    StackPush(stack, 2);

    while (!StackEmpty(stack)) {
        printf("%d ", stack->_data[stack->_top]);
        StackPop(stack);
    }
    printf("\n");

    StackDestroy(stack);
}

void test2() {
    printf("test2\n");
    Stack* stack = StackInit();
    StackPush(stack, 1);
    StackPush(stack, 2);
    StackPush(stack, 3);
    StackPush(stack, 4);

    printf("size: %d\n", StackSize(stack));

    while (!StackEmpty(stack)) {
        printf("%d ", stack->_data[stack->_top]);
        StackPop(stack);
    }
    printf("\n");
    printf("size: %d\n", StackSize(stack));

    StackDestroy(stack);

}

void test3() {
    Stack* stack = StackInit();
    StackPush(stack, 1);
    StackPush(stack, 2);
    StackPush(stack, 3);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);
    StackPush(stack, 4);


    while (!StackEmpty(stack)) {
        printf("%d ", stack->_data[stack->_top]);
        StackPop(stack);
    }
    printf("\n");

    StackDestroy(stack);
}

int main() {
    test1();
    test2();
    test3();
    return 0;
}